Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with changes in IOData (prepare_segmented) #196

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

tovrstra
Copy link
Member

@tovrstra tovrstra commented Aug 2, 2024

The required function is imported locally from the iodata library because the wrapper module also contains a wrapper for pyscf. When the import is made at the top and IOData is not installed, it would also become impossible to use the pyscf wrapper. (You may want to split the wrapper module into one per package to avoid local imports, but this is not critical.)

This commit includes a few side effects:

  • Ruff fixes were required in wrappers.py to make the commit.
  • .envrc is added to .gitignore. I used direnv for managing environments

Checklist

  • Write a good description of what the PR does.
  • Tests pass locally
  • Pre-commit passes
  • Add tests for each unit of code added (e.g. function, class)
  • Update documentation
  • Squash commits that can be grouped together
  • Rebase onto master

Type of Changes

Type
🐛 Bug fix

Related

Fixes #195

Fixes theochem#195

The required function is imported locally from the iodata library
because the wrapper module also contains a wrapper for pyscf.
When the import is made at the top and IOData is not installed,
it would also become impossible to use the pyscf wrapper.
(You may want to split the wrapper module into one per package
to avoid local imports, but this is not critical.)

This commit includes a few side effects:

- Ruff fixes were required in wrappers.py to make the commit.
- .envrc is added to .gitignore. I used direnv for managing environments
@tovrstra tovrstra added the bug Something isn't working label Aug 2, 2024
Copy link
Collaborator

@leila-pujal leila-pujal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tovrstra, thanks a lot for your quick PR to fix issue #195. I checked your new code locally with the latest IOData with one of my scripts and it works. All tests that use from_iodata pass as well. You may be right and we should split pyscf and iodata wrappers now that we have this import specific to IOData. I think maybe because from_pyscf is not a big function they decided to put both into one module and of course, they were not importing any specific functionality. I will open an issue as an enhancement so we can keep track of this suggestion. Related to your side effects: The Ruff changes match the ones I did in wrappers.py in #193 . I will merge this PR and update #193 so no problem. Thanks for adding the .envrc to .gitignore . I am not sure how new direnv is but we should keep track better of new tools for managing enviromental variables and add them to .gitingnore. I will soon deal with PR #187 and #193. I will merge this at the end of the day to give more time to Canadian people if they want to review it as well. Thanks again!

@tovrstra
Copy link
Member Author

tovrstra commented Aug 2, 2024

You're welcome. Thanks for the review. I'll let you do the merging, so you can decide in which order to deal with the PRs.

@leila-pujal leila-pujal merged commit 126f558 into theochem:master Aug 6, 2024
0 of 10 checks passed
@tovrstra tovrstra deleted the update-iodata-segmented branch August 8, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] from_iodata not working after API change of iodata
2 participants